﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;

namespace G.Web
{
    [DataContract]
    public class ResponseData
    {
        [DataMember(Name = "error")]
        public string Error
        {
            get;
            set;
        }

        [DataMember(Name = "error_code")]
        public float Error_code
        {
            get;
            set;
        }

        [DataMember(Name = "request")]
        public string Request
        {
            get;
            set;
        }
        /// <summary>
        /// 响应原始内容
        /// </summary>
        public string Body { get; set; }

        public bool IsError
        {
            get
            {
                if (string.IsNullOrEmpty(Error))
                {
                    return false;
                }
                return true;
            }
        }
    }

    [DataContract]
    public class ResponseData<T> : ResponseData
    {
        public T Response { get; set; }
    }
}
